CC =g++
#FLAGS related to  VISP
VISP_BUILD_DIR =-I/usr/local/ViSP/ViSP-build
#VISP_CFLAGS =`$(VISP_BUILD_DIR)/bin/visp-config --cflags`
#VISP_LDFLAGS = `$(VISP_BUILD_DIR)/bin/visp-config --libs`
VISP_CFLAGS = `visp-config --cflags`
VISP_LDFLAGS =`visp-config --libs`


#FLAGS related to OPENCV
OPENCV_INCLUDE_DIR=-I/usr/local/include
OPENCV_CFLAGS=`pkg-config opencv --cflags`
OPENCV_LDFLAGS=`pkg-config opencv --libs`


CFLAGS=-c -Wall $(VISP_CFLAGS) $(OPENCV_CFLAGS)
LDFLAGS= $(VISP_LDFLAGS) $(OPENCV_LDFLAGS)
SOURCES= VisualServo.cpp VisualServo.hpp Controller.cpp
OBJECTS=$(SOURCES:.cpp=.o)

EXECUTABLE=VisualServo

all: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS) 
	$(CC)  $(OBJECTS) $(LDFLAGS) -o $@

.cpp.o:
	$(CC) $(CFLAGS) $< -o $@

